<?php

	//constraints
	require_once '../database/sql.php'; //database
	require_once '../modules/menu.php'; //menu class
	$rows = sql_load(); //load the database into an array

/********************************Appetizers***********************************/

	//stuffed Jalapenos
	$cost = 4.99;
	$about = '<b>Stuffed&nbsp;Jalapenos</b>: Fried jalapenos stuffed with
		cheese';
	$build = array($rows['build']['jalapenos'], $rows['build']['cheese']);
	$extra = array($rows['build']['onions'],$rows['build']['avocado'],
				$rows['build']['bell pepper']);
	$stuffed_jalapenos = new MENU($build,array(),array(),$about,$cost); 
	$stuffed_jalapenos->possible_items(array(),$extra,$rows);
	//$stuffed_jalapenos->output();

	//Guacamole Salad
	$cost = 4.99; 
	$about = '<b>Guacamole&nbsp;Salad</b>: Avocados, lime juice, tomato, 
		and onions';
	$build = array($rows['build']['avocado'],$rows['build']['lime'],
		$rows['build']['tomatoes']);
	$extra = array($rows['build']['bacon'],$rows['build']['lettuce'],
				$rows['build']['jalapenos']);
	$guacamole_salad = new MENU($build,array(),array(),$about,$cost);
	$guacamole_salad->possible_items(array(),$extra,$rows);
	//$guacamole_salad->output();

	//Cheese Dip
	$cost = 3.99;
	$about = '<b>Chile&nbsp;con&nbsp;Queso</b>: Melted cheese dip';
	$extra = array($rows['meat']['beef'],$rows['meat']['Grilled Chicken'],
				$rows['build']['jalapenos']);
	$ccq = new MENU(array($rows['build']['cheese']),array(),array(),$about,
		$cost);
	$ccq->possible_items(array(),$extra,$rows);
	//$ccq->output();

	//array containing appetizers
	$appetizers = array(
		'Stuffed Jalapenos' => $stuffed_jalapenos,
		'Guacamole Salad' => $guacamole_salad,
		'Chile con Queso' => $ccq,
	);

/********************************Steaks****************************************/

	//base for steaks
	$base = array($rows['base']['rice'],$rows['base']['black beans']);
	$build = array($rows['build']['bell pepper'],$rows['build']['onions']);

	//Donald's Rib-Eye
	$cost = 21.99;
	$about = '<b>Donald\'s&nbsp;Rib-Eye</b>: 21 Oz. Steak';
	$extra = array($rows['build']['bacon'],$rows['meat']['t bone']);
	$meat = array($rows['meat']['rib eye']);
	$rib_eye = new MENU($build,$base,$meat,$about,$cost);
	$rib_eye->possible_items(array(),$extra,$rows);
	//$rib_eye->output();

	//Tyler's T-Bone
	$cost = 16.99;
	$about = '<b>Tyler\'s&nbsp;T-Bone</b>: 16 Oz. Steak';
	$extra = array($rows['build']['celery'],$rows['build']['spinach'],
				$rows['build']['broccoli'],$rows['build']['corn']);
	$meat = array($rows['meat']['t bone']);
	$t_bone = new MENU($build,$base,$meat,$about,$cost);
	$t_bone->possible_items(array(),$extra,$rows);
	//$t_bone->output();

	//array containing all steaks
	$steaks = array(
		'Rib Eye' => $rib_eye,
		'T Bone' => $t_bone,
	);

/********************************Tortilla Wraps********************************/

	//base for tacos
	$base = array($rows['base']['rice'],$rows['base']['refried beans']);
	$build = array($rows['build']['bell pepper'],$rows['build']['onions'],
		$rows['build']['tortillas'], $rows['build']['avocado']);

	//Fajita tacos
	$cost = 5.99;
	$about = '<b>Fajita tacos</b>: Two fajita tacos';
	$extra = array($rows['meat']['Grilled Chicken'],$rows['meat']['fish']);
	$meat = array($rows['meat']['beef']);
	$fajita_tacos = new MENU($build,$base,$meat,$about,$cost);
	$fajita_tacos->possible_items(array(),$extra,$rows);
	//$fajita_tacos->output();

	//Burritos
	$cost = 7.99;
	$about = '<b>Burrito</b>: Beef Fajita burrito';
	$extra = array($rows['meat']['Grilled Chicken'],$rows['build']['jalapenos']);
	$meat = array($rows['meat']['beef']);
	$burrito = new MENU($build,$base,$meat,$about,$cost);
	$burrito->possible_items(array(),$extra,$rows);
	//$burrito->output();

	//array containing all tacos
	$tacos = array(
		'Fajita Tacos' => $fajita_tacos,
		'Burrito' => $burrito,
	);

/********************************Entrees***************************************/

	//base for entrees
	$base = array($rows['base']['rice'],$rows['base']['black beans']);
	$build = array($rows['build']['tomatoes'],$rows['build']['onions'],
		$rows['build']['lime'], $rows['build']['tortillas']);

	//Gerardo's Grilled Chicken
	$cost = 6.99;
	$about = '<b>Gerardo\'s&nbsp;Grilled&nbsp;Chickentacos</b>: Grilled chicken
		breast covered in Chile con Queso';
	$special_build = array($rows['build']['tomatoes'],$rows['build']['onions'],
		$rows['build']['lime'], $rows['build']['cheese']);
	$extra = array($rows['build']['bacon'],$rows['build']['avocado'],
				$rows['build']['broccoli'],$rows['build']['mushrooms']);
	$meat = array($rows['meat']['Grilled Chicken']);
	$grilled_chicken = new MENU($special_build,$base,$meat,$about,$cost);
	$grilled_chicken->possible_items(array(),$extra,$rows);
	//$grilled_chicken->output();

	//Frank's Fajitas
	$cost = 7.99;
	$about = '<b>Frank\'s&nbsp;Fajitas</b>: Fajitas served with tortillas ';
	$extra = array($rows['build']['bacon'],$rows['build']['avocado'],
				$rows['build']['broccoli'],$rows['build']['mushrooms'],
				$rows['meat']['Grilled Chicken']);
	$meat = array($rows['meat']['beef']);
	$fajitas = new MENU($build,$base,$meat,$about,$cost);
	$fajitas->possible_items(array(),$extra,$rows);
	//$fajitas->output();

	//ceviche
	$cost = 8.99;
	$about = '<b>Ceviche</b>: Fresh raw fish';
	$extra = array($rows['build']['celery'],$rows['build']['spinach']);
	$meat = array($rows['meat']['fish']);
	$ceviche = new MENU($build,$base,$meat,$about,$cost);
	$ceviche->possible_items(array(),$extra,$rows);
	//$ceviche->output();

	//array containing all entrees
	$entrees = array(
		'Grilled Chicken' => $grilled_chicken,
		'Fajitas' => $fajitas,
		'Ceviche' => $ceviche,
	);

/********************************Healthy***************************************/

	//vegetable soup
	$cost = 5.99;
	$about = '<b>Vegetable&nbsp;Soup</b>: served with carrots, mushrooms,
		onions, and bell peppers';
	$build = array($rows['build']['carrots'],$rows['build']['mushrooms'],
		$rows['build']['bell pepper']);
	$base = array($rows['base']['broth']);
	$extra = array($rows['build']['corn'],$rows['build']['peas'],
				$rows['build']['celery'],$rows['base']['rice']);
	$vegetable_soup = new MENU($build,$base,array(),$about,$cost);
	$vegetable_soup->possible_items(array(),$extra,$rows);
	//$vegetable_soup->output();

	//Rice and Eggplant
	$cost = 7.99;
	$about = '<b>Rice&nbsp;Eggplant</b>: eggplant served with rice and
		vegetables';
	$build = array($rows['build']['squash'],$rows['build']['broccoli'],
		$rows['build']['carrots']);
	$base = array($rows['base']['rice'],$rows['base']['black beans']);
	$extra = array($rows['build']['corn'],$rows['build']['peas'],
				$rows['build']['celery']);
	$eggplant = new MENU($build,$base,array(),$about,$cost);
	$eggplant->possible_items(array(),$extra,$rows);
	//$eggplant->output();

	//array containing all healthy items
	$healthy = array(
		'Vegetable Soup' => $vegetable_soup,
		'Eggplant' => $eggplant,
	);

/*********************************Dessert*************************************/

	//tres leches cake
	$cost = 4.99;
	$about = '<b>Gerardo\'s&nbsp;Tres&nbsp;Leches</b>: Homemade cake bathed 
				in luscious milk';
	$base = array($rows['base']['milk'],$rows['base']['cake']);
	$extra = array($rows['base']['chocolate']);
	$tres_leches = new MENU(array(),$base,array(),$about,$cost);
	//$tres_leches->output();
	$tres_leches->possible_items(array(),$extra,$rows);

	//sopapilla
	$cost = 2.99;
	$about = '<b>Sopapilla</b>: Fried tortilla with powdered sugar';
	$build = array($rows['build']['tortillas']);
	$base = array($rows['base']['sugar']);
	$extra = array($rows['base']['chocolate']);
	$sopapilla = new MENU($build,$base,array(),$about,$cost);
	//$sopapilla->output();
	$sopapilla->possible_items(array(),$extra,$rows);
	
	//array containing all deserts
	$desserts = array(
		'Tres Leches' => $tres_leches,
		'Sopapilla' => $sopapilla,
	);

/*********************************Conclusion**********************************/

	//array to contain all the items
	$master = array(
		'appetizers' => $appetizers,
		'steaks' => $steaks,
		'tacos' => $tacos,
		'entrees' => $entrees,
		'healthy' => $healthy,
		'desserts' => $desserts,
	);
	
?>
